#ifndef _PRIMITIVE_STREAM_HPP_
#define _PRIMITIVE_STREAM_HPP_

#include "mif.h"
#include <fstream>

namespace ModuleEMapData
{

  class StreamError
  {
  public:
    StreamError( int _id );

    int get_errid( void ) const { return error_id; }

    const char* get_error_msg( void ) { return error_info[ error_id ]; }

    enum {
      UNVALID_FILE_FORMAT = 0,
      END_OF_STREAM,
      ERROR_MAX
    };

  private:
    int error_id;

    static const char *error_info[ ERROR_MAX+1 ];
  };

  class PrimitiveStream
  {
  public:
    virtual bool                     eof( void ) const = 0;
    virtual PrimitiveStream&         operator>>( primitive& p ) = 0;
  };

}

#endif//_PRIMITIVE_STREAM_HPP_			\
